The present invention relates generally to flow processing and, more specifically, to a method, system, and computer program product for optimizing runtime branch selection in a flow process.
There are many enterprise service bus (ESB) systems that incorporate two stages in their construction. One stage is tooling, in which a net of composable units are wired together to form an overall flow, which conceptually describes a particular function of an ESB module. The second stage is where tooling-generated artifacts are rendered into a runtime system, and reflects the executable instantiation of the conceptual flow. One example of such a system is the pairing of IBM® WebSphere Integration Developer, which provides the ESB tooling support, and IBM® WebSphere Enterprise Service Bus, which provides the runtime environment. As a natural consequence of flow development, there may be a number of routes, or branches within a flow. In some instances, all branches may be activated for a particular flow, and in some cases, branches will be conditional based upon some runtime context. Each of the runtime components representing the composable units may have different behavioral characteristics. For example some components may log the flow of data to a database and others may transform the data based on a provided schema. Equally, branches may be commutable inasmuch as the order in which they are performed is not relevant to their business function. Regardless of the commutability of these branches with respect to a business function, there may well be a performance difference when activating branches in different orders.
An example of such a difference can be drawn from a typical enterprise service bus. Consider the simple case of a runtime flow consisting of two branches A and B, in which A simply logs the data but B transforms it before moving into some other referenced service. If B is performed before A, the runtime infrastructure will need to make a clone of the data before the transformation so that the logging performed by A acts on the original data. However, if A is performed before B, no such issue will occur since A does not change the data. In this way, performing A before B is the most advantageous order in which to perform the flow in the runtime system.
Thus, it would be desirable to provide a means for re-ordering branch executions that would optimize performance of the underlying flow.